package jsyf.oa.entity.system;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * Created by Maqiuqiu on 2018/7/21.
 */
@Entity
@Table(name = "T_SYS_MESSAGE_RECEIVER", schema = "oa", catalog = "")
public class MessageReceiverEntity extends BaseEntity implements Serializable {

    private String messageId;
    private String userId;
    private Integer userType;
    private Integer readFlag;

    public String getMessageId() {
        return messageId;
    }

    public void setMessageId(String messageId) {
        this.messageId = messageId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public Integer getReadFlag() {
        return readFlag;
    }

    public void setReadFlag(Integer readFlag) {
        this.readFlag = readFlag;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject json = new JSONObject();
        json.put("ID",this.getId());
        json.put("MESSAGE_ID",this.getMessageId());
        json.put("USER_ID",this.getUserId());
        json.put("USER_TYPE",this.getUserType());
        json.put("READ_FLAG",this.getReadFlag());
        return json;
    }

    @Override
    public String getTableName() {
        return "T_SYS_MESSAGE_RECEIVER";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject json = new JSONObject();
        json.put("ID","id");
        json.put("MESSAGE_ID","messageId");
        json.put("USER_ID","userId");
        json.put("USER_TYPE","userType");
        json.put("READ_FLAG","readFlag");
        return json;
    }
}
